home *** CD-ROM | disk | FTP | other *** search
/ 8bitfiles.net/archives / archives.tar / archives / compuserve-file-archive / 04 geoProgramming / GPUTIL.BIN (.txt) < prev    next >
Encoding:
GEOS ConVerT  |  2019-04-13  |  5.5 KB  |  251 lines

  1. UTILITIES1-SRC
  2. PRG formatted GEOS file V1.0
  3. MPS-801+
  4. UTILITIES1-SRC
  5. LASTER'S 
  6. ONVERTER 
  7. Write Image V2.0
  8. geoWrite    V2.0
  9. T-Grab Data V2
  10. Please Select Option:
  11. new document
  12. existing document
  13. to deskTop
  14. Insert new disk into disk     
  15. .if (0)
  16. ***************************************************
  17. Generic Disk Error Handler
  18. @Author:
  19.     William C. Coleman
  20. @Date:
  21.     22 March 1988
  22. @Notice:
  23.     Copyright (C) 1988, BlasterSoft, William C. Coleman
  24. page 1    tables and text strings for DiskError.
  25. page 2    DiskError
  26. page 3    HiBeep,LowBeep,Beep
  27. page 4    ClearScreen
  28. ***************************************************
  29. .endif
  30. .if    Pass1
  31.     .noeqin
  32.     .noglbl
  33.     .include    geosSym
  34.     .include    geosMac
  35.     .eqin
  36.     .glbl
  37. .endif
  38.             .psect
  39. @DErr_Box:
  40. .byte    DEF_DB_POS|1
  41.     .byte    DBTXTSTR,42,TXT_LN_1_Y
  42.      .word    derrtext
  43.     .byte    DBVARSTR,TXT_LN_X,TXT_LN_3_Y,r5
  44.     .byte    DB_USR_ROUT
  45.      .word    HiBeep
  46.     .byte    OK,DBI_X_2,DBI_Y_2
  47.     .byte    NULL
  48. @err1:    
  49. .byte "Not Enough Blocks",NULL
  50. @err2:    
  51. .byte "Invalid Track",NULL
  52. @err3:    
  53. .byte "Insufficient Space",NULL
  54. @err4:    
  55. .byte "Directory is Full",NULL
  56. @err5:    
  57. .byte "File Not Found",NULL
  58. @err6:    
  59. .byte "Bad BAM in Drive",NULL
  60. @err7:
  61.     .byte "Can't Organize a REU",NULL  ;Should be UNOPEN_VLIR_FILE
  62. @err10:    
  63. .byte "Geos Structure Mismatch",NULL
  64. @err11:    
  65. .byte "Buffer OverFlow",NULL
  66. @err12:
  67.     .byte "Directory is Empty",NULL     ;Should be CANCEL_ERR
  68. @err13:    
  69. .byte "Device Not Present",NULL
  70. @err20:    
  71. .byte "No Header Block",NULL
  72. @err21:    
  73. .byte "Unformatted or Missing Disk",NULL
  74. @err22:    
  75. .byte "No Data Block Found",NULL
  76. @err23:    
  77. .byte "Data Checksum Error",NULL
  78. @err24:    
  79. .byte "Incompatable Filetypes",NULL
  80. @err25:    
  81. .byte "Write Verify Error",NULL
  82. @err26:    
  83. .byte "Write Protect On",NULL
  84. @err27:    
  85. .byte "Header Checksum Error",NULL
  86. @err29:    
  87. .byte "Disk ID Mismatch",NULL
  88. @err73:    
  89. .byte "DOS Mismatch",NULL
  90. @errxx:
  91.     .byte "Unrecognized Error Code",NULL
  92. @derrtext:    
  93. .byte BOLDON,"* Disk Error *",NULL
  94. @errtab:
  95. .word    err1,err2,err3,err4,err5,err6,errxx
  96.     .word    errxx,errxx,err10,err11,err12,err13
  97. @errtabhi:
  98.     .word    err20,err21,err22,err23,err24,err25,err26,err27,errxx,err29
  99.  Code",NULL
  100. @derrtext:    
  101. .byte BOLDON,"* Disk Error *",NULL
  102. @errtab:
  103. .word    err1,err2,err3,err4,err5,err6,errxx
  104.     .word    errxx,errxx,err10,err11,err12,err13
  105. @errtabhi:
  106.     .word    err20,err21,err22,err23,err24,err25,err26,err27,
  107. ;**************************************************
  108. @DiskError
  109.  - Opens an OK dialog box to inform user that there
  110. ;        was a disk error.
  111. @Pass:
  112.     X - error code
  113. @Return:
  114.     nothing
  115. ;**************************************************
  116. @DiskError:
  117.         pha        ;Save registers
  118.         txa
  119.         pha
  120.         tya
  121.         pha
  122.         PushW    r5
  123.         PushB    currentMode
  124.         cpx    #$20
  125.         bcs    01$        ;Branch if high error
  126.         dex
  127.         txa
  128.         asl    a
  129.         tay
  130.         bra    04$    
  131. @01$:
  132.         cpx    #$73    ;This one is not consecutive...
  133.         bne    02$    ;...so we check it by hand
  134.         LoadW    r5,err73
  135.         bne    05$    ;Always branches
  136. @02$:
  137.         cpx    #$2a        ;Highest error code+1
  138.         bcc    03$
  139.         LoadW    r5,errxx    ;Unrecognized error
  140.         bne    05$    ;Always branches
  141. @03$:
  142.         txa        ;Do high error group
  143.         sbc    #$1f
  144.         asl    a
  145.         tay
  146. @04$:
  147.         lda    errtabhi,y
  148.         sta    r5L
  149.         lda    errtabhi+1,y
  150.         sta    r5H
  151. @05$:
  152.         LoadW    r0,DErr_Box
  153.         jsr    DoDlgBox
  154.         PopB    currentMode
  155.         PopW    r5
  156.         pla
  157.         tax
  158.         pla
  159.         tay
  160.         pla
  161.         rts
  162. @03$:
  163.         txa        ;Do high error grou
  164. ;**************************************************
  165. @HiBeep, LowBeep
  166.  - Generates a bell-like tone.
  167. @Pass,Return,Destroyed:    
  168. Nothing
  169. ;**************************************************
  170. @LowBeep:
  171.         pha
  172.         txa
  173.         pha
  174.         tya
  175.         pha
  176.         ldx    #40
  177.         bne    LBP_
  178. @HiBeep:
  179.         pha
  180.         txa
  181.         pha
  182.         tya
  183.         pha
  184.         ldx    #20
  185. @LBP_:
  186.         jsr    Beep
  187.         pla
  188.         tay
  189.         pla
  190.         tax
  191.         pla
  192.         rts
  193. ;**************************************************
  194. @Beep
  195.  -    Generates a bell-like tone.
  196. @Pass:
  197.   X - frequency
  198. @Return:
  199.  Volume left at maximum
  200. @Destroyed: 
  201. A,X,Y
  202. ;**************************************************
  203. @Beep:
  204.         sei
  205.         LoadB    CPU_DATA,IO_IN
  206.         stx    sidbase+1
  207.         ldy    #0
  208.         sty    sidbase+5    ;Y will be used in loop
  209.         LoadB    sidbase+6,%11111001
  210.         LoadB    sidbase+15,55
  211.         LoadB    sidbase+24,15
  212.         ldx    #%00010101
  213.         stx    sidbase+4        ;Gate sound on
  214. @01$:
  215.         dey
  216.         bne    01$
  217.         dex
  218.         bne    01$
  219.         LoadB    sidbase+4,%00010100
  220.         LoadB    CPU_DATA,RAM_64K
  221.         cli
  222.         rts
  223. ;**************************************************
  224. @ClearScreen
  225.  - Clears the screen *fast* to bg 0
  226. ;**************************************************
  227. @ClearScreen:
  228.         LoadW    r0,SCREEN_BASE
  229.         LoadW    r1,BACK_SCR_BASE
  230.         ldx    #$7d
  231. @01$:
  232.         ldy    #$3f
  233.         lda    #0
  234. @02$:
  235.         sta    (r0),y
  236.         sta    (r1),y
  237.         dey
  238.         bpl    02$
  239.         lda    r0L
  240.         add    #$40
  241.         sta    r0L
  242.         sta    r1L
  243.         bcc    03$
  244.         inc    r0H
  245.         inc    r1H
  246. @03$:
  247.         dex
  248.         bne    01$
  249.         rts
  250. ;************************  EOF: UTILITIES
  251.